package me.ivps.android.themedemo;

import android.content.Context;
import android.preference.PreferenceManager;

public class SettingUtil {
    
    private static final String CHOOSED_THEME = "CHOOSED_THEME";
    
    public static int getTheme(Context context) {
        
        return PreferenceManager.getDefaultSharedPreferences(context).getInt(
                CHOOSED_THEME, 0);
    }
    
    public static void setTheme(Context context, int theme) {
        
        PreferenceManager.getDefaultSharedPreferences(context).edit()
                .putInt(CHOOSED_THEME, theme).apply();
    }
}
